<template>
	<view>
		<u-input v-model="value" :type="type" :border="border" placeholder="请输入姓名"/>
		<u-button type="success" @click="ensure()">确定</u-button>
		<!-- Toast消息提示 -->
		<u-toast ref="uToast" />
	</view>
</template>

<script>
	export default {
		data() {
			return {
				value: '',
				type: 'text',
				border: true,
			}
		},
		methods:{
			ensure(){
				//修改用户姓名
				this.$store.state.user.userInfo.userName = this.$data.value;
				//DOTO 更改数据库信息
				//消息提示并跳转页面
				this.$refs.uToast.show({
					title: '修改成功！！',
					type: 'success',
					url: 'pages/person-second-page/userDetails-page/userDetails-page'
				})
				
			}
		}
	}
</script>
	
<style>
	
</style>